﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Orchard.Services;
using Orchard.Environment.Extensions;
using Orchard;
using Orchard.Environment.Features;

namespace RaisingStudio.Razor.Services
{
    [OrchardFeature("RaisingStudio.Razor.Services.RazorHtmlFilter")]
    public class RazorHtmlFilter : IHtmlFilter
    {
        private IRazorService razorService;
        private IOrchardServices orchardServices;
        private IFeatureManager featureManager;

        public RazorHtmlFilter(IOrchardServices orchardServices, IFeatureManager featureManager, IRazorService razorService)
        {
            this.orchardServices = orchardServices;
            this.featureManager = featureManager;
            this.razorService = razorService;
        }

        public string ProcessContent(string text)
        {
            return this.razorService.Run(text, this.orchardServices);
        }

        public string ProcessContent(string text, string flavor)
        {
            return this.razorService.Run(text, this.orchardServices);
        }
    }
}